import request from "./request";

/**
 * 新增数据集
 * @param newDataSet
 * @returns {AxiosPromise}
 */
export const uploadDataSet = (newDataSet)=>{
    return request({
        method: 'POST',
        headers: { 'content-type': 'application/x-www-form-urlencoded' },
        url: '/dataset/new',
        data: newDataSet
    })
}

/**
 * 搜索
 * @param form
 * @returns {AxiosPromise}
 */
export const searchDataSet = (form) => {
    return request({
        method: 'GET',
        url: '/dataset/search',
        params: form
    })
}


/**
 * 下载标注文件
 * @param idList
 * @param type
 * @returns {AxiosPromise}
 */
export const downloadAnnotationFile = (idList, type) => {
    return request({
        method: 'GET',
        url: '/annotationFile/download',
        params:{
            idList: idList,
            type: type
        }
    })
}
